package com.practice.controller.admin;


import com.practice.common.result.Result;
import com.practice.pojo.admin.dto.AdvimgDTO;
import com.practice.pojo.admin.dto.AdvimgPageDTO;
import com.practice.service.admin.AdvimgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author itcast
 * @since 2023-05-15
 */
@RestController
@RequestMapping("/ydd_advimg")
public class AdvimgController {


    @Autowired
    private AdvimgService advimgService;

    //广告图详情
    @GetMapping("/rowInfo")
    public Result advimgDetail(Integer id){
        return advimgService.advimgDetail(id);
    }

    //广告图删除
    @GetMapping("/del")
    public Result advimgDelete(Integer id){
        return advimgService.advimgDelete(id);
    }


    //广告图列表-分页查询
    @GetMapping("/list")
    public Result page(AdvimgPageDTO advimgPageDTO){
        return advimgService.pageList(advimgPageDTO);
    }


    //广告图修改
    @PostMapping("/update")
    public Result advimgUpdate(@RequestBody AdvimgDTO advimgDTO){
        return advimgService.advimgUpdate(advimgDTO);
    }

    //广告图添加
    @PostMapping("/add")
    public Result advimgAdd(@RequestBody AdvimgDTO advimgDTO){
        return advimgService.advimgAdd(advimgDTO);
    }

}
